/*
 * @Author: llch
 * @Date: 2020-06-12 15:41:10
 * @LastEditTime: 2020-06-19 08:44:44
 * @LastEditors: Please set LastEditors
 * @Description: 每个类项组件
 * @FilePath: \man_demo\assets\Script\Category\Item.ts
 */ 
const {ccclass, property} = cc._decorator;

@ccclass
export class Item extends cc.Component {

    // 分类图片精灵
    @property(cc.Sprite)
    public category: cc.Sprite = null;
    
    // 记录当前的分类id
    public index: number = 0;

    // 记录该分类的图片数据
    public data = null;

    // 设置分类图片
    public setCategoryImg (sf: cc.SpriteFrame, index: number) {
        this.category.spriteFrame = sf;
        this.index = index;
    }
}